package org.tea.inventory.model.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.tea.inventory.base.validation.groups.UpdateGroup;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
    * 优惠券信息
    */
@ApiModel(description="兑换券信息")
@Getter
@Setter
@NoArgsConstructor
public class CouponDto implements Serializable {
    /**
     * id
     */
    @NotNull(message = "id不能为空", groups = {UpdateGroup.class})
    private Long id;

    /**
     * 券分类 1-永久 2-有效
     */
    @ApiModelProperty("券分类 1-永久 2-有效")
    @NotBlank(message = "券分类不能为空", groups = {CouponDto.class, UpdateGroup.class})
    private String couponType;

    /**
     * 兑换券图片
     */
    @ApiModelProperty("兑换券图片")
//    @NotBlank(message = "兑换券图片不能为空", groups = {CouponDto.class, UpdateGroup.class})
    private String couponImg;


    @ApiModelProperty("使用类型")
    @NotBlank(message = "分类券，商品券")
    private String useType;

    /**
     * 兑换券名字
     */
    @ApiModelProperty("兑换券名称")
    @NotBlank(message = "兑换券名称不能为空", groups = {CouponDto.class, UpdateGroup.class})
    private String couponName;

    @ApiModelProperty("数量")
    private Integer num;


    /**
     * 备注
     */
    @ApiModelProperty("备注")
    private String remark;

    /**
     * 截至日期
     */
    @ApiModelProperty("截至日期")
    @JsonFormat(timezone = "GMT+8",pattern="yyyy-MM-dd")
    private Date enableEndTime;


    /**
     * 状态 -1-删除 0-关闭 1-开启 2-失效
     */
    @ApiModelProperty( "状态 -1-删除 0-关闭 1-开启")
    private String status;

    @ApiModelProperty( "关联商品id")
    private List<Long> skuIds;

    @ApiModelProperty( "关联分类")
    private List<String> categorys;

    @ApiModelProperty( "积分类型 0-不可转换 0-可转换")
    private String integralType;

    @ApiModelProperty( "积分")
    private Long integral;

    private boolean check;
    private static final long serialVersionUID = 1L;
}